-----------------------------------
-- Area: Lower Jeuno
-- NPC: Honorine
-- Standard Info NPC
-----------------------------------

require("scripts/globals/settings");
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
require("scripts/zones/Lower_Jeuno/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)


    if (trade:hasItemQty(4096,12)) then
    
    if (player:getFreeSlotsCount() > 0) then  
  player:addItem(4104, 1); 
  player:messageSpecial(ITEM_OBTAINED,4104);
  player:tradeComplete();
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4104);
    end
	end  
            if (trade:hasItemQty(4097,12)) then
   
    if (player:getFreeSlotsCount() > 0) then 
  player:addItem(4105, 1);
  player:messageSpecial(ITEM_OBTAINED,4105);
  player:tradeComplete();
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4105);
    end
    end  
	         if (trade:hasItemQty(4098,12)) then
   
    if (player:getFreeSlotsCount() > 0) then
   
  player:addItem(4106, 1);
  player:messageSpecial(ITEM_OBTAINED,4106);
  player:tradeComplete();
 
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4106);
    end
    end
	            if (trade:hasItemQty(4099,12)) then
   
    if (player:getFreeSlotsCount() > 0) then
   
  player:addItem(4107, 1);
  player:messageSpecial(ITEM_OBTAINED,4107);
  player:tradeComplete();
 
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4107);
    end
    end
	            if (trade:hasItemQty(4100,12)) then
   
    if (player:getFreeSlotsCount() > 0) then
   
  player:addItem(4108, 1);
  player:messageSpecial(ITEM_OBTAINED,4108);
  player:tradeComplete();
 
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4108);
    end
    end  
       
       
       
       
            if (trade:hasItemQty(4101,12)) then
   
    if (player:getFreeSlotsCount() > 0) then
   
  player:addItem(4109, 1);
  player:messageSpecial(ITEM_OBTAINED,4109);
  player:tradeComplete();
 
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4109);
    end
    end 
	            if (trade:hasItemQty(4102,12)) then
   
    if (player:getFreeSlotsCount() > 0) then
   
  player:addItem(4110, 1);
  player:messageSpecial(ITEM_OBTAINED,4110);
  player:tradeComplete();
 
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4110);
    end
    end  
       
       
       
            if (trade:hasItemQty(4103,12)) then
   
    if (player:getFreeSlotsCount() > 0) then
   
  player:addItem(4111, 1);
  player:messageSpecial(ITEM_OBTAINED,4111);
  player:tradeComplete();
 
    else
    player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,4111);
    end
    end

end; 

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
local	duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
local rand = math.random(1,2417)
	player:setHomePoint();
	player:messageSpecial(6474);
player:messageSpecial(ITEM_OBTAINED,4306,1);
		player:delStatusEffect(EFFECT_SIGNET);
		player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
			player:addStatusEffect(EFFECT_FLEE,200,0,10);
			player:costume(rand)
			player:addStatusEffect(EFFECT_COSTUME,rand,0,3600);			
end; 

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------





